package com.joinway.framework.data.jdbc.bean;

import java.util.List;

import org.jsondoc.core.annotation.ApiObject;
import org.jsondoc.core.annotation.ApiObjectField;

import com.joinway.framework.bean.domain.constant.SqlConstants;

@ApiObject(name = "QueryCriteria", description = "RMDB查询SQL格式")
public class QueryCriteria extends Criteria {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@ApiObjectField(description="true-带有distinct的查询，false-不带distinct的查询，默认false",required=false) 
	private boolean distinct = false;
	
	@ApiObjectField(description="javaBean命名规则的数据库列名，如果查询所有列，值为*;可以是String或List<String>类型,默认为*",required=false) 
	private Object fields = SqlConstants.Key.All;
	
	@ApiObjectField(description="排序字段",required=false) 
	private List<OrderItem> order;
	
	@ApiObjectField(description="页号",required=false) 
	private Integer page;
	
	@ApiObjectField(description="每页数据个数",required=false) 
	private Integer rows;

	public boolean isDistinct() {
		return distinct;
	}

	public void setDistinct(boolean distinct) {
		this.distinct = distinct;
	}

	public Object getFields() {
		return fields;
	}

	public void setFields(Object fields) {
		this.fields = fields;
	}

	public List<OrderItem> getOrder() {
		return order;
	}

	public void setOrder(List<OrderItem> order) {
		this.order = order;
	}

	public Integer getPage() {
		return page;
	}

	public void setPage(Integer page) {
		this.page = page;
	}

	public Integer getRows() {
		return rows;
	}

	public void setRows(Integer rows) {
		this.rows = rows;
	}
}
